<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>清除浮动</title>
		<style type="text/css">
			ul{
				width: 600px;
				background: pink;
			}
			li{
				list-style-type: none;
				width: 100px;
				height: 50px;
				float: left;
				background: #87CEEB;
			}
			/*ul::after{				/*清除浮动代码*/
				content: '.';		/*兼容设置，不加.也行*/
				display: block;
				clear: both;
				height: 0;					}	/*兼容设置*/
				

			.feleclear::after,.feleclear::before{		/*双伪元素清除浮动和防止div塌陷*/
				content: '';
				display: table;
			}
			.feleclear::after{
				clear: both;
			}
			div{
				width: 800px;
				height: 400px;
				background: aqua;
				/*clear: both;		加在块级上面才行*/
				overflow: hidden;		/*清除浮动，加在父级*/
			}
			p{
				float: left;
			}
		</style>
	</head>
	<body>
		<ul class="feleclear">
			<li>1</li>
			<li>2</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
			<li>6</li>
		</ul>
		
		<div>
			<p>随风倒士大夫</p>
			<p>啊实打实打算</p>
			<p>萨达萨达萨达</p>
		</div>
	</body>
</html>
